/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "gallery")
@NamedQueries({
    @NamedQuery(name = "Gallery.findAll", query = "SELECT g FROM Gallery g")})
public class Gallery implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "gallery_id")
    private Integer galleryId;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "vessel_id")
    private Vessel vessel;
    
    @Column(name = "document_path")
    private String documentPath;
    
    @Column(name = "filename")
    private String filename;
    
    @Column(name = "caption")
    private String caption;
    
    @Column(name = "year_taken")
    private String yearTaken;
    
    @Column(name = "month_taken")
    private String monthTaken;
    
    @Column(name = "uploaded_by")
    private String uploadedBy;

    public String getCaption() {
        return caption;
    }

    public void setCaption(String caption) {
        this.caption = caption;
    }

    public Gallery() {
    }

    public Gallery(Integer galleryId) {
        this.galleryId = galleryId;
    }

    public Integer getGalleryId() {
        return galleryId;
    }

    public void setGalleryId(Integer galleryId) {
        this.galleryId = galleryId;
    }

    public Vessel getVessel() {
        return vessel;
    }

    public void setVessel(Vessel vessel) {
        this.vessel = vessel;
    }

    public String getDocumentPath() {
        return documentPath;
    }

    public void setDocumentPath(String documentPath) {
        this.documentPath = documentPath;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getYear() {
        return yearTaken;
    }

    public void setYear(String yearTaken) {
        this.yearTaken = yearTaken;
    }

    public String getMonth() {
        return monthTaken;
    }

    public void setMonth(String monthTaken) {
        this.monthTaken = monthTaken;
    }

    public String getUploadedBy() {
        return uploadedBy;
    }

    public void setUploadedBy(String uploadedBy) {
        this.uploadedBy = uploadedBy;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (galleryId != null ? galleryId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Gallery)) {
            return false;
        }
        Gallery other = (Gallery) object;
        if ((this.galleryId == null && other.galleryId != null) || (this.galleryId != null && !this.galleryId.equals(other.galleryId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.Gallery[ galleryId=" + galleryId + " ]";
    }
    
}
